<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="telephone=no" name="format-detection" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>酱子-日本料理</title>
<link type="text/css" rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="huiyuan_box fl"> 
  <!--数量加减-->
  <link rel="stylesheet" href="css/jquery.spinner.css" />
  <!--数量加减end--> 
  <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script> 
  <script src="js/jquery-1.8.3.min.js" type="text/javascript"></script> 
  <!--end--> 
  <!--分类导航固定-->
  <link rel="stylesheet" type="text/css" href="css/index.css" >
  <!--分类导航固定--> 
  <!--公告js--> 
  
  <script type="text/javascript" src="js/jquery.min.js"></script> 
  <script type="text/javascript">
	function timer(opj){
		$(opj).find('ul').animate({
			marginTop : "-50px"  
			},500,function(){  
			$(this).css({marginTop : "0px"}).find("li:first").appendTo(this);  
		})  
	}
	$(function(){ 
		var num = $('.notice_active').find('li').length;
		if(num > 1){
		   var time=setInterval('timer(".notice_active")',3500);
			$('.gg_more a').mousemove(function(){
				clearInterval(time);
			}).mouseout(function(){
				time = setInterval('timer(".notice_active")',3500);
			}); 
		}
		
		$(".news_ck").click(function(){
			location.href = $(".notice_active .notice_active_ch").children(":input").val();
		})
	});
</script>
  </head>
  <link href="css/gwc.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="js/jquery.1.4.2-min.js"></script> 
  <script type="text/javascript" src="js/Calculation.js"></script> 
  <script type="text/javascript">
$(document).ready(function () {

	//jquery特效制作复选框全选反选取消(无插件)
	// 全选        
	$(".allselect").click(function () {
		
		if($(this).attr("checked")){
			$(".gwc_tb2 input[name=gwcid[]]").each(function () {
				$(this).attr("checked", true);
				// $(this).next().css({ "background-color": "#3366cc", "color": "#ffffff" });
			});
			GetCount();
		
		}
		else
   		{
			$(".gwc_tb2 input[name=gwcid[]]").each(function () {
				if ($(this).attr("checked")) {
					$(this).attr("checked", false);
					//$(this).next().css({ "background-color": "#ffffff", "color": "#000000" });
				} else {
					$(this).attr("checked", true);
					//$(this).next().css({ "background-color": "#3366cc", "color": "#000000" });
				} 
			});
			GetCount();
    
   		}
		
	});

	//反选
	$("#invert").click(function () {
		$(".gwc_tb2 input[name=gwcid[]]").each(function () {
			if ($(this).attr("checked")) {
				$(this).attr("checked", false);
				//$(this).next().css({ "background-color": "#ffffff", "color": "#000000" });
			} else {
				$(this).attr("checked", true);
				//$(this).next().css({ "background-color": "#3366cc", "color": "#000000" });
			} 
		});
		GetCount();
	});

	//取消
	$("#cancel").click(function () {
		$(".gwc_tb2 input[name=gwcid[]]").each(function () {
			$(this).attr("checked", false);
			// $(this).next().css({ "background-color": "#ffffff", "color": "#000000" });
		});
		GetCount();
	});

	// 所有复选(:checkbox)框点击事件
	$(".gwc_tb2 input[name=gwcid[]]").click(function () {
		if ($(this).attr("checked")) {
			//$(this).next().css({ "background-color": "#3366cc", "color": "#ffffff" });
		} else {
			// $(this).next().css({ "background-color": "#ffffff", "color": "#000000" });
		}
	});

	// 输出
	$(".gwc_tb2 input[name=gwcid[]]").click(function () {
		// $("#total2").html() = GetCount($(this));
		GetCount();
		//alert(conts);
	});
});
//******************
function GetCount() {
	var conts = 0;
	var aa = 0;
	$(".gwc_tb2 input[name=gwcid[]]").each(function () {
		if ($(this).attr("checked")) {
			for (var i = 0; i < $(this).length; i++) {
				conts += parseInt($(this).val());
				aa += 1;
			}
		}
	});
	$("#shuliang").text(aa);
	$("#zong1").html((conts).toFixed(2));
	$("#jz1").css("display", "none");
	$("#jz2").css("display", "block");
}
</script>
  <div class="gwc1" style=" margin-top:30px;">
    <table cellpadding="0" cellspacing="0" class="gwc_tb1" style="width:100%; background:#757575;">
      <tr>
        <td width="10%" align="center" valign="middle"><input id="Checkbox1" type="checkbox"  class="allselect"/></td>
        <td >全选</td>
        <!--<td class="tb1_td3">商品</td>
			<td class="tb1_td4">单价</td>
			<td class="tb1_td5">数量</td>
			<td class="tb1_td6">合计</td>
			<td class="tb1_td7">操作</td>--> 
      </tr>
    </table>
    <form action="fk.php" method="post" name="myform" id="myform" onSubmit="return CheckForm();">
      <div>
        <?php $n=1;
			            $db -> query("select ddid,cpid,sl from $table_dd where uid=".$_SESSION['dxc_uid']." and ddzt=0 and gwczt=0 and Type=201 order by ddid desc limit 50");
			            while ($db -> next_record()){
						$rs = $db1->query_first("select Title,content,jg,pic,chk,yj from $table_cp where id=".$db -> f('cpid')."");
						if($rs1['dengji']==1){
							$jg=$rs['jg'];
							}else{
							$jg=$rs['yj'];	
								}
		              ?>
        <!---商品加减算总数----> 
        <script type="text/javascript">
	$(function () {
		var t = $("#text_box<?php echo $n;?>");
		$("#add<?php echo $n;?>").click(function () {
	
         t.val(parseInt(t.val()) + 1)
			setTotal(); GetCount();
     
			
		})
		$("#min<?php echo $n;?>").click(function () {
			if(t.val()>1){
				t.val(parseInt(t.val()) - 1)
				setTotal(); GetCount();
			}
		})
		function setTotal() {

			$("#total<?php echo $n;?>").html((parseInt(t.val()) * <?php echo $jg?>).toFixed(2));
			//$("#gwcid-<?php echo $n;?>").val(parseInt(t.val()) * <?php echo $rs['jg']?>);
		}
		setTotal();
	})
	</script>
        <table cellpadding="0" cellspacing="0" class="gwc_tb2" width="100%">
          <tr>
            <td width="10%" rowspan="5" align="center" valign="middle" ><input type="checkbox" value="<? echo $db -> f('ddid'); ?>" name="gwcid[]" id="gwcid-<?php echo $n;?>" />
              <input name="newslist[]" type="hidden" value="<? echo $db -> f('ddid'); ?>">
              
              <!--<input name="cpid[]" type="hidden" value="<? echo $db-> f('cpid'); ?>">--></td>
            <td width="25%" rowspan="4" ><a href="cpxx.php?id=<? echo $db -> f('cpid'); ?>"><img src="<?php echo str_replace("../"," ",$rs['pic'])?>" width="80%"/></a></td>
            <td height="25" align="left" ><a style="color:#666;" href="#">产品名称</a></td>
            <td width="10%" height="25" align="left" ><a style="color:#f00;" href="delgwc.php?ddid=<? echo $db -> f('ddid'); ?>">删除</a></td>
          </tr>
          <tr>
            <td height="25" align="left" style="font-size:0.9em;">单价：132元</td>
            <td height="25" align="left" ></td>
          </tr>
          <tr>
            <td style="font-size:0.9em;">数量：
              <input id="min<?php echo $n;?>" name=""  style=" width:20px; height:18px;border:1px solid #ccc;" type="button" value="-" />
              <input id="text_box<?php echo $n;?>" name="sl[]" type="text" value="<? echo $db -> f('sl'); ?>" readonly style=" width:30px; text-align:center; border:1px solid #ccc;" />
              <input id="add<?php echo $n;?>" name="" style=" width:20px; height:18px;border:1px solid #ccc;" type="button" value="+" /></td>
            <td ></td>
          </tr>
          <tr>
            <td height="25" colspan="3" align="right" style="font-size:0.9em; padding-right:2%;">合计：
              <label id="total<?php echo $n;?>" class="tot" style="color:#ff5500;font-size:14px; font-weight:bold;"></label></td>
          </tr>
        </table>
        <?php $n=$n+1;} ?>
        
        <!---总数----> 
        <script type="text/javascript">
	$(function () {
		$(".quanxun").click(function () {
			setTotal();
			//alert($(lens[0]).text());
		});
		function setTotal() {
			var len = $(".tot");
			var num = 0;
			for (var i = 0; i < len.length; i++) {
				num = parseInt(num) + parseInt($(len[i]).text());

			}
			//alert(len.length);
			$("#zong1").text(parseInt(num).toFixed(2));
			$("#shuliang").text(len.length);
		}

		//setTotal();
	})
	</script> 
      </div>
      
    </form><div class="bottom_center_box">
  <ul>
    <li><a href="/"><img src="images/sc_index_bottom_r1_c15.jpg" /><span>会员</span></a></li>
    <li><a href="liquanbao.html"><img src="images/sc_index_bottom_r1_c6.jpg" /><span>礼券包</span></a></li>
    <li><a href="shangcheng.html"><img src="images/sc_index_bottom_r1_c1.jpg" /><span> 购物商城</span></a></li>
    <li><a href="jifen.html"><img src="images/sc_index_bottom_r1_c16.jpg" /><span>积分商城</span></a></li>
  </ul>
</div>
</body></html>
  </div>
</div>
